-
Notifications
You must be signed in to change notification settings - Fork 40
Revisit importTable() in Consensus Commit #3102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @brfrn169, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request removes the getImportTableMetadata and addRawColumnToTable methods from the DistributedStorageAdmin interface and related classes, as well as disables corresponding tests for Cassandra and DynamoDB, and modifies the importTable method in ConsensusCommitAdmin. The review focuses on the correctness of removing these methods and the impact on the overall system.
core/src/main/java/com/scalar/db/transaction/consensuscommit/ConsensusCommitAdmin.java
Show resolved
Hide resolved
.../src/main/java/com/scalar/db/transaction/consensuscommit/TwoPhaseConsensusCommitManager.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the import table functionality by removing deprecated getImportTableMetadata and addRawColumnToTable methods from the DistributedStorageAdmin interface and its implementations, simplifying the import process to use importTable directly followed by addNewColumnToTable for metadata columns.
Key changes:
- Removed
getImportTableMetadataandaddRawColumnToTablemethods from the admin API interfaces and all implementations - Updated
ConsensusCommitAdmin.importTableto calladmin.importTable()first, then add columns usingaddNewColumnToTableinstead ofaddRawColumnToTable - Refactored batch operation read-only checks to use
instanceof Selectioninstead of checking forGetorScanindividually - Removed associated tests for the deleted methods
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
core/src/main/java/com/scalar/db/api/DistributedStorageAdmin.java |
Removed getImportTableMetadata and addRawColumnToTable method declarations from interface |
core/src/main/java/com/scalar/db/common/CommonDistributedStorageAdmin.java |
Removed wrapper implementations for deleted methods |
core/src/main/java/com/scalar/db/service/AdminService.java |
Removed delegation implementations for deleted methods |
core/src/main/java/com/scalar/db/storage/multistorage/MultiStorageAdmin.java |
Removed routing implementations for deleted methods |
core/src/main/java/com/scalar/db/storage/jdbc/JdbcAdmin.java |
Removed addRawColumnToTable implementation and changed getImportTableMetadata visibility to package-private |
core/src/main/java/com/scalar/db/storage/dynamo/DynamoAdmin.java |
Removed unsupported operation stubs for deleted methods |
core/src/main/java/com/scalar/db/storage/cosmos/CosmosAdmin.java |
Removed unsupported operation stubs for deleted methods |
core/src/main/java/com/scalar/db/storage/cassandra/CassandraAdmin.java |
Removed unsupported operation stubs for deleted methods |
core/src/main/java/com/scalar/db/transaction/consensuscommit/ConsensusCommitAdmin.java |
Refactored importTable to call admin.importTable() first, then use addNewColumnToTable instead of addRawColumnToTable |
core/src/main/java/com/scalar/db/transaction/jdbc/JdbcTransactionManager.java |
Simplified batch read-only check to use instanceof Selection |
core/src/main/java/com/scalar/db/transaction/consensuscommit/TwoPhaseConsensusCommitManager.java |
Simplified batch read-only check to use instanceof Selection |
core/src/test/java/com/scalar/db/transaction/consensuscommit/ConsensusCommitAdminTestBase.java |
Updated test to verify importTable is called before adding columns, changed assertions to use addNewColumnToTable |
core/src/test/java/com/scalar/db/storage/multistorage/MultiStorageAdminTest.java |
Removed test for deleted getImportTableMetadata method |
core/src/test/java/com/scalar/db/storage/jdbc/JdbcAdminTest.java |
Removed tests for deleted addRawColumnToTable method |
core/src/test/java/com/scalar/db/storage/dynamo/DynamoAdminTestBase.java |
Removed unsupported operation tests for deleted methods, renumbered remaining test variables |
core/src/test/java/com/scalar/db/storage/cosmos/CosmosAdminTest.java |
Removed unsupported operation tests for deleted methods, renumbered remaining test variables |
core/src/test/java/com/scalar/db/storage/cassandra/CassandraAdminTest.java |
Removed unsupported operation tests for deleted methods, renumbered remaining test variables |
integration-test/src/main/java/com/scalar/db/api/DistributedStorageAdminPermissionIntegrationTestBase.java |
Removed integration tests for deleted methods |
core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoAdminPermissionIntegrationTest.java |
Removed disabled test overrides for deleted methods |
core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraAdminPermissionIntegrationTest.java |
Removed disabled test overrides for deleted methods |
core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcSchemaLoaderImportIntegrationTest.java |
Added missing @AfterAll annotation to afterAll method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/main/java/com/scalar/db/transaction/consensuscommit/ConsensusCommitAdmin.java
Show resolved
Hide resolved
core/src/main/java/com/scalar/db/transaction/consensuscommit/ConsensusCommitAdmin.java
Show resolved
Hide resolved
komamitsu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
Torch3333
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
feeblefakie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
jnmt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Description
This PR revisits the logic of the
importTable()method in Consensus Commit.Related issues and/or PRs
N/A
Changes made
ConsensusCommitAdmin.importTable()method to calladmin.importTable()first, then add columns usingaddNewColumnToTable()instead ofaddRawColumnToTable().getImportTableMetadata()andaddRawColumnToTable()methods from the admin API interfaces and all implementationsChecklist
Additional notes (optional)
N/A
Release notes
N/A